<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<import type="js" file="js.jquery" />
<import type="js" file="js.common" />
<import type="css" file="css.global" />
<import type="css" file="css.form" />
<import file="js.My97DatePicker.WdatePicker" />
</head>
<body>
<div class="search">
	<b>管理流程 - {$data_sort.sort_name}</b>
</div>
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
        <tr>
            <th width="10%">序号</th>
            <th width="30%">流程</th>
            <th width="15%">表单</th>
            <th width="30%">各项属性</th>
            <th width="15%">操作</th>
        </tr>
    </thead>
 
    <tbody>
   	  <volist name="data_type" id="vo" empty="$empty">
        <tr>
        	<td align="center">{$i}</td>
			<td>{$vo.type_name}</td>
			<td><a href="javascript:void(0);" onclick="view({$vo.form_id})" title="预览表单">预览</a></td>
			<td>
			  <a href="javascript:void(0);" onclick="edit({$vo.type_id})"><img border=0 src="__PUBLIC__/images/edit.gif" align="absmiddle"> 基本属性</a>&nbsp;
	          <a href="javascript:void(0);" onclick="flow({$vo.type_id});"><img border=0 src="__PUBLIC__/images/arrow_down.gif" width="11" height="13" align="absmiddle"> 流程设计器</a>&nbsp;
			 </td>
			 <td>
			 <if condition="$vo['status'] eq 1" >
				<a href="javascript:void(0);" onclick="disable_form({$vo.type_id},{$data_sort.sort_id},0);" title="点击禁用">启用</a>
			<else />
				<a href="javascript:void(0);" onclick="disable_form({$vo.type_id},{$data_sort.sort_id},1);" title="点击启用">禁用</a>
			</if>
				| <a href="javascript:void(0);" onclick="delete_form({$vo.type_id},{$data_sort.sort_id});">删除</a>
			</td>
        </tr>
      </volist>
    </tbody>
</table>
</div>
</body>
<script language="javascript">
$(document).ready(function(){  
	$(".stripe tr").mouseover(function(){    
	  $(this).addClass("over");}).mouseout(function(){   
			$(this).removeClass("over");}) 
  	$(".stripe tr:even").addClass("alt");
}); 
function delete_form(type_id,sort_id)
{
	msg='确认要删除该流程么？\n这将删除以下数据：\n\n1、流程描述与步骤设置\n2、依托于该流程的所有工作';
	if(confirm(msg))
	{
		$.get("__APP__/WorkFlowSys/flow_type_delete?type_id="+type_id+"&sort_id="+sort_id, function(result){
			location.reload();
			parent.frames['list'].refresh()
		});
	}
}
function disable_form(type_id, sort_id, status){
	if(status == 0){
		msg='确认要禁用该流程么？';
	}else{
		msg='确认要启用该流程么？';
	}
	if(confirm(msg))
	{
		$.get("__APP__/WorkFlowSys/flow_type_disable?type_id="+type_id+"&sort_id="+sort_id+"&status="+status, function(result){
			alert(result);
			location.reload();
		});
	}
}

function view(form_id){
	myleft=(screen.availWidth-1000)/2;
	window.open("__APP__/WorkFlowSys/flow_form_info?form_id="+form_id,"proc_view","status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=1000,height=400,left="+myleft+",top=100");

}

function edit(type_id){
	window.location="__APP__/WorkFlowSys/flow_type_edit?type_id="+type_id;
}

function flow(type_id){
	window.location="__APP__/WorkFlowSys/flow_process?type_id="+type_id;
}
</script>
</html>